﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>多个过渡效果</title>
</head>
<body>
    <style>
        .v-enter-active, .v-leave-active {
            transition: all 0.5s ease;
        }
        .v-etner, .v-leave-to {
            opacity: 0.2;
            transform: translateX(150px);
        }
        .my-transition-enter-active, .my-transition-leave-active {
            transition: all 0.8s ease;
        }
        .my-transition-enter, .my-transition-leave-to {
            opacity: 0.2;
            transform: translateY(200px);
        }
    </style>
    <div id="app">
        <button v-on:click="show=!show">
            点击我
        </button>
        <transition>
            <p v-if="!show">默认为name为空，使用v-enter</p>
        </transition>
        <transition name="my-transition">
            <p v-if="!show">name为my-transition动画</p>
        </transition>
    </div>

<!--引入vue文件-->
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script>
    const vm = Vue.createApp({
        data() {
            return {
                show: true
            }
        }
    }).mount('#app');
</script>
</body>
</html>
